package com.yuanwushe.blue.model;

import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.provider.MediaStore;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by blue on 2018/5/20.
 */

public class VideoItem {
    public String name;
    public String path;
    public Bitmap thumb;
    public String createdTime;

    public VideoItem(String name, String path, String createdTime)
    {
        this.name = name;
        this.path = path;
        SimpleDateFormat sf = new SimpleDateFormat("yy年MM月dd日HH时mm分");
        Date date = new Date(Long.valueOf(createdTime) * 1000);
        this.createdTime = sf.format(date);
        this.thumb = ThumbnailUtils.createVideoThumbnail(path, MediaStore.Images.Thumbnails.MINI_KIND);
    }
}
